local glass_table = { --name, description, texture
   {'blue1', 'Blue Prism', '1'},
   {'green1', 'Green Prism', '2'},
   {'red1', 'Red Prism', '3'},
   {'blue2', 'Blue Diamonds', '4'},
   {'green2', 'Green Diamonds', '5'},
   {'red2', 'Red Diamonds', '6'},
   {'yg', 'Yellow in Green', '7'},
   {'floral', 'Floral Pattern', '8'},
   {'rb', 'Red in Blue', '9'},
}

for i in ipairs (glass_table) do
   local name = glass_table[i][1]
   local desc = glass_table[i][2]
   local texture = glass_table[i][3]

   minetest.register_node('stainedglass:'..name..'s', {
      description = desc..' Glass',
      drawtype = 'nodebox',
      node_box = {
         type = 'fixed',
         fixed = {-0.5, -0.5, -0.04, 0.5, 0.5, 0.04}
      },
      tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'stainedglass-'..texture..'.png', 'stainedglass-'..texture..'.png'},
      inventory_image = 'stainedglass-'..texture..'.png',
      use_texture_alpha = true,
      sunlight_propagates = true,
      paramtype = 'light',
      paramtype2 = 'facedir',
      groups = {oddly_breakable_by_hand=3},
   })

   minetest.register_node('stainedglass:'..name..'d', {
      description = desc..' Glass (Double Height)',
      drawtype = 'nodebox',
      node_box = {
         type = 'fixed',
         fixed = {-0.5, -0.5, -0.04, 0.5, 1.5, 0.04}
      },
      tiles = {'blank.png', 'blank.png', 'blank.png', 'blank.png', 'stainedglass-'..texture..'.png', 'stainedglass-'..texture..'.png'},
      inventory_image = 'stainedglass-'..texture..'.png^stainedglass-x2.png',
      use_texture_alpha = true,
      sunlight_propagates = true,
      paramtype = 'light',
      paramtype2 = 'facedir',
      groups = {oddly_breakable_by_hand=3},
   })

   minetest.register_craft({
      output = 'stainedglass:'..name..'d',
      recipe = {
         {'stainedglass:'..name..'s'},
         {'stainedglass:'..name..'s'}
      }
   })
end
